home *** CD-ROM | disk | FTP | other *** search
/ Logiciels PC 7 / logiciel pc 7.iso / Linux / KDE_1.1pr2_Rpm / kdesupport-1.1pre2-1rh5x.i386.rpm / kdesupport-1.1pre2.1rh5x.cpio.gz / kdesupport-1.1pre2.1rh5x.cpio / opt / kde / bin / kdm_on < prev    next >
Text File  |  1999-01-27  |  2KB  |  70 lines

  1. #!/bin/bash
  2. #  script for replacing xdm with kdm as the runlevel 5 Display Manager
  3. #  on RedHat 5.x Linux (modifies /etc/inittab)
  4. #  also modifies /etc/X11/xdm/Xsetup_0 to use the kdmdesktop
  5. if [ "$KDEDIR" = "" ] ; then
  6.     echo "\"kdm_on\" cannot run because \$KDEDIR is not set:"
  7.     echo "(Log in again as root, and try again)"
  8.     exit 
  9. fi
  10.  
  11. INITTAB="/etc/inittab"
  12. XSETUP="/etc/X11/xdm/Xsetup_0"
  13. KDM="$KDEDIR/bin/kdm"
  14.  
  15. echo "Configuring the KDE X Display Manager (kdm) to replace xdm"
  16. echo "($INITTAB and $XSETUP will be modified)" 
  17.  
  18. if ! [ -f $INITTAB ] ; then
  19.      echo "error: $INITTAB does not exist: exiting"
  20.      exit
  21. fi
  22.  
  23. if ! [ -f $XSETUP ] ; then
  24.      echo "error: $XSETUP does not exist: exiting"
  25.      exit
  26. fi
  27.  
  28. if ! [ -f $KDM ] ; then
  29.      echo "error: $KDM does not appear to exist; exiting"
  30.      echo "(is the correct kdebase rpm installed?)"
  31.      exit
  32. fi
  33.  
  34. if ! cp -pf $INITTAB $INITTAB.tmp ; then 
  35.      echo 'error: "kdm_on" must be run as root: exiting' 
  36.      exit
  37. fi
  38. cp -pf $XSETUP $XSETUP.tmp
  39.  
  40.  
  41. # make modified inittab
  42. # (just using $XSETUP.tmp for a temporary file in processing $INITTAB.)
  43. sed  -e "/kdm/d" $INITTAB > $XSETUP.tmp
  44.  
  45. sed -e "s/^x:5:respawn:/\#x:5:respawn:/g" $XSETUP.tmp > $INITTAB.tmp
  46. echo "x:5:respawn:/usr/bin/env KDEDIR=$KDEDIR $KDEDIR/bin/kdm -nodaemon" >> $INITTAB.tmp
  47.  
  48. # make modified Xsetup_0
  49. sed  -e "/kdmdesktop/d" $XSETUP > $XSETUP.tmp
  50. echo "$KDEDIR/bin/kdmdesktop" >> $XSETUP.tmp
  51.  
  52. echo "saving old $XSETUP as $XSETUP.kdesave"
  53. mv -f $XSETUP $XSETUP.kdesave
  54. mv -f $XSETUP.tmp  $XSETUP
  55.  
  56. echo "saving old $INITTAB  as $INITTAB.kdesave"
  57. mv -f $INITTAB $INITTAB.kdesave
  58. mv -f $INITTAB.tmp $INITTAB
  59.  
  60. echo "The runlevel-5 X Display Manager will now be kdm"
  61. echo 'To restart runlevel 5 using kdm, type "telinit 3 ; telinit 5" '
  62. echo 'To restore the RedHat default X Display Mananger (xdm), type "kdm_off"'
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.